; Kliper setup && update script
;
;
;


[Setup]
AppName=Kliper
AppVerName=Kliper 0.6.2-beta1
AppPublisher=Kliper Team
AppPublisherURL=http://www.kliper.xt.pl
AppSupportURL=http://www.kliper.xt.pl
AppUpdatesURL=http://www.kliper.xt.pl
ChangesAssociations=yes
DefaultDirName={pf}\Kliper
DefaultGroupName=Kliper
LicenseFile=C:\kliper_svn\LICENSE.txt
InfoBeforeFile=C:\kliper_svn\README.txt
OutputDir=C:\kliper_svn\setup
OutputBaseFilename=kliper-setup
Compression=lzma/normal
;SolidCompression=yes
;AppMutex=kliper

[CustomMessages]
english.kliper_language="english.lang"
polish.kliper_language="polski.lang"

[Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"
Name: "polish"; MessagesFile: "compiler:Languages\Polish.isl"

[Tasks]
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked
Name: "quicklaunchicon"; Description: "{cm:CreateQuickLaunchIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked

[Components]
Name: "assign"; Description: "Odtwarzaj pliki wideo w Kliperze"
Name: "assign\avi"; Description: "Pliki avi"; Types: full custom compact
Name: "assign\mpg"; Description: "Pliki mpg"; Types: full custom compact
Name: "assign\mov"; Description: "Pliki mov"; Types: full
Name: "assign\asf"; Description: "Pliki asf"; Types: full
Name: "assign\asx"; Description: "Pliki asx"; Types: full
Name: "assign\mp4"; Description: "Pliki mp4"; Types: full
Name: "assign\rm"; Description: "Pliki rm"; Types: full
Name: "assign\divx"; Description: "Pliki divx"; Types: full
Name: "assign\xvid"; Description: "Pliki xvid"; Types: full
Name: "assign\wmv"; Description: "Pliki wmv"; Types: full
Name: "assign\mpeg"; Description: "Pliki mpeg"; Types: full custom compact
Name: "assign\vob"; Description: "Pliki vob"; Types: full
Name: "assign\ogm"; Description: "Pliki ogm"; Types: full
Name: "assign\qt"; Description: "Pliki qt"; Types: full
Name: "assign\mkv"; Description: "Pliki mkv"; Types: full
Name: "assign\ogg"; Description: "Pliki ogg"; Types: full

Name: "assign"; Description: "Odtwarzaj pliki audio w Kliperze"
Name: "assign\mp3"; Description: "Pliki mp3"; Types:
Name: "assign\wav"; Description: "Pliki wav"; Types:



[Files]
; Main Program files

; executables
Source: "C:\kliper\kliper.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\kliper\unzip32.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\kliper\mplayer.exe"; DestDir: "{app}"; Flags: ignoreversion

; directories
Source: "C:\kliper\codecs\*"; DestDir: "{app}\codecs"; Flags: ignoreversion recursesubdirs createallsubdirs
Source: "C:\kliper\drivers\*"; DestDir: "{app}\drivers"; Flags: ignoreversion recursesubdirs createallsubdirs
Source: "C:\kliper\fonts\*"; DestDir: "{app}\fonts"; Flags: ignoreversion recursesubdirs createallsubdirs
Source: "C:\kliper\lang\*.lang"; DestDir: "{app}\lang"; Flags: ignoreversion recursesubdirs createallsubdirs


; TXT addons
Source: "C:\kliper\MPlayer-AUTHORS"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\kliper\LICENSE.txt"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\kliper\AUTHORS.txt"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\kliper\README.txt"; DestDir: "{app}"; Flags: ignoreversion

; URLs and shortcuts
Source: "C:\kliper\kliper.url"; DestDir: "{app}"; Flags: ignoreversion

; Config files
Source: "C:\kliper\config.ini"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\kliper\dumpfile"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\kliper\format"; DestDir: "{app}"; Flags: ignoreversion


; NOTE: Don't use "Flags: ignoreversion" on any shared system files

[INI]
Filename: "{app}\kliper.url"; Section: "InternetShortcut"; Key: "URL"; String: "http://www.kliper.xt.pl"
Filename: "{app}\config.ini"; Section: "main"; Key: "lang"; String: "{cm:kliper_language}"

[Icons]
Name: "{group}\Kliper"; Filename: "{app}\kliper.exe"
Name: "{group}\{cm:ProgramOnTheWeb,Kliper}"; Filename: "{app}\kliper.url"
Name: "{group}\{cm:UninstallProgram,Kliper}"; Filename: "{uninstallexe}"
Name: "{userdesktop}\Kliper"; Filename: "{app}\kliper.exe"; Tasks: desktopicon
Name: "{userappdata}\Microsoft\Internet Explorer\Quick Launch\Kliper"; Filename: "{app}\kliper.exe"; Tasks: quicklaunchicon

[Run]
Filename: "{app}\kliper.exe"; Description: "{cm:LaunchProgram,Kliper}"; Flags: nowait postinstall skipifsilent

[UninstallDelete]
Type: files; Name: "{app}\Kliper.url"

[Registry]
Root: HKCR; Subkey: "Kliper"; ValueType: string; ValueName: ""; ValueData: "Kliper multimedia player"; Flags: uninsdeletekey
Root: HKCR; Subkey: "Kliper\DefaultIcon"; ValueType: string; ValueName: ""; ValueData: "{app}\kliper.exe,0"
Root: HKCR; Subkey: "Kliper\shell\open\command"; ValueType: string; ValueName: ""; ValueData: """{app}\kliper.exe"" ""%1"""

;------------------------------ Extensions associations --------------------------------
; VIDEO
Root: HKCR; Subkey: ".avi"; ValueType: string; ValueName: ""; ValueData: "Kliper"; Flags: uninsdeletevalue;  Components: "assign\avi"
Root: HKCR; Subkey: ".mpg"; ValueType: string; ValueName: ""; ValueData: "Kliper"; Flags: uninsdeletevalue;  Components: "assign\mpg"
Root: HKCR; Subkey: ".mov"; ValueType: string; ValueName: ""; ValueData: "Kliper"; Flags: uninsdeletevalue; Components: "assign\mov"
Root: HKCR; Subkey: ".asf"; ValueType: string; ValueName: ""; ValueData: "Kliper"; Flags: uninsdeletevalue;  Components: "assign\asf"
Root: HKCR; Subkey: ".asx"; ValueType: string; ValueName: ""; ValueData: "Kliper"; Flags: uninsdeletevalue;  Components: "assign\asx"
Root: HKCR; Subkey: ".mp4"; ValueType: string; ValueName: ""; ValueData: "Kliper"; Flags: uninsdeletevalue; Components: "assign\mp4"
Root: HKCR; Subkey: ".rm"; ValueType: string; ValueName: ""; ValueData: "Kliper"; Flags: uninsdeletevalue;  Components: "assign\rm"
Root: HKCR; Subkey: ".divx"; ValueType: string; ValueName: ""; ValueData: "Kliper"; Flags: uninsdeletevalue;  Components: "assign\divx"
Root: HKCR; Subkey: ".xvid"; ValueType: string; ValueName: ""; ValueData: "Kliper"; Flags: uninsdeletevalue; Components: "assign\xvid"
Root: HKCR; Subkey: ".wmv"; ValueType: string; ValueName: ""; ValueData: "Kliper"; Flags: uninsdeletevalue;  Components: "assign\wmv"
Root: HKCR; Subkey: ".mpeg"; ValueType: string; ValueName: ""; ValueData: "Kliper"; Flags: uninsdeletevalue; Components: "assign\mpeg"
Root: HKCR; Subkey: ".vob"; ValueType: string; ValueName: ""; ValueData: "Kliper"; Flags: uninsdeletevalue;  Components: "assign\vob"
Root: HKCR; Subkey: ".ogm"; ValueType: string; ValueName: ""; ValueData: "Kliper"; Flags: uninsdeletevalue;  Components: "assign\ogm"
Root: HKCR; Subkey: ".qt"; ValueType: string; ValueName: ""; ValueData: "Kliper"; Flags: uninsdeletevalue;  Components: "assign\qt"
Root: HKCR; Subkey: ".mkv"; ValueType: string; ValueName: ""; ValueData: "Kliper"; Flags: uninsdeletevalue; Components: "assign\mkv"
Root: HKCR; Subkey: ".ogg"; ValueType: string; ValueName: ""; ValueData: "Kliper"; Flags: uninsdeletevalue; Components: "assign\ogg"
; AUDIO
Root: HKCR; Subkey: ".mp3"; ValueType: string; ValueName: ""; ValueData: "Kliper"; Flags: uninsdeletevalue; Components: "assign\mp3"
Root: HKCR; Subkey: ".wav"; ValueType: string; ValueName: ""; ValueData: "Kliper"; Flags: uninsdeletevalue; Components: "assign\wav"


[Code]

// Zamykamy dzialajacego klipera by nadpisac pliki
procedure CurStepChanged(CurStep: TSetupStep);
var x:thandle;
begin
  if CurStep=ssInstall then begin
    x:=findwindowbyclassname('Tklipermainform');
    sendmessage(x,16,0,0);
  end;

end;



